package com.fr.chart.plot;

import com.fr.base.background.ColorBackground;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.base.equals.Equals;
import com.fr.chart.core.glyph.CategoryAxis3DGlyph;
import com.fr.chart.core.glyph.CategoryAxisGlyph;
import com.fr.chart.core.glyph.DateAxis3DGlyph;
import com.fr.chart.core.glyph.Line3DPlotGlyph;
import com.fr.chart.core.glyph.PlotGlyph;
import com.fr.chart.core.glyph.ValueAxis3DGlyph;
import com.fr.chart.core.glyph.ValueAxisGlyph;
import com.fr.chart.legend.LineMarkerIcon;
import com.fr.chart.math.Plot3D;
import com.fr.chart.math.Projection;
import com.fr.data.ChartData;
import java.awt.Color;
import java.awt.Insets;

public class Line3DPlot extends CategoryPlot
  implements Plot3D
{
  private static final long serialVersionUID = -4538377327051227336L;
  private Projection projection = new Projection();
  private double seriesIntervalPercent = 0.0D;
  private int deep = -1;

  public Line3DPlot()
  {
    setBackground(ColorBackground.getInstance(new Color(171, 222, 239)));
  }

  public PlotGlyph createPlotGlyph(ChartData paramChartData)
  {
    Line3DPlotGlyph localLine3DPlotGlyph = new Line3DPlotGlyph();
    install4PlotGlyph(localLine3DPlotGlyph, paramChartData);
    installAxisGlyph(localLine3DPlotGlyph, paramChartData);
    return localLine3DPlotGlyph;
  }

  public void install4PlotGlyph(Line3DPlotGlyph paramLine3DPlotGlyph, ChartData paramChartData)
  {
    super.install4PlotGlyph(paramLine3DPlotGlyph, paramChartData);
    paramLine3DPlotGlyph.setProjection(this.projection);
    paramLine3DPlotGlyph.setDeep(this.deep);
    paramLine3DPlotGlyph.setSeriesIntervalPercent(this.seriesIntervalPercent);
  }

  protected void dealCondition(LineMarkerIcon paramLineMarkerIcon, int paramInt)
  {
    dealColorCondition(paramLineMarkerIcon, paramInt);
  }

  public ValueAxisGlyph createValueAxisGlyph()
  {
    return new ValueAxis3DGlyph(this.valueAxis);
  }

  public CategoryAxisGlyph createCategoryAxisGlyph()
  {
    return new CategoryAxis3DGlyph(this.categoryAxis);
  }

  public CategoryAxisGlyph createDateAxisGlyph()
  {
    return new DateAxis3DGlyph(this.categoryAxis);
  }

  public void setProjection(Projection paramProjection)
  {
    this.projection = paramProjection;
  }

  public Projection getProjection()
  {
    return this.projection;
  }

  public void setDeep(int paramInt)
  {
    this.deep = paramInt;
  }

  public int getDeep()
  {
    return this.deep;
  }

  public void setSeriesIntervalPercent(double paramDouble)
  {
    this.seriesIntervalPercent = paramDouble;
  }

  public double getSeriesIntervalPercent()
  {
    return this.seriesIntervalPercent;
  }

  public Insets createOuterIntsets()
  {
    return new Insets(30, 20, 20, 50);
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if ("Projection".equals(str1))
        this.projection = ((Projection)paramXMLableReader.readXMLObject(new Projection()));
      if ("Line3DAttr".equals(str1))
      {
        String str2;
        if ((str2 = paramXMLableReader.getAttr("seriesIntervalPercent")) != null)
          this.seriesIntervalPercent = Double.parseDouble(str2);
        if ((str2 = paramXMLableReader.getAttr("deep")) != null)
          setDeep(Integer.parseInt(str2));
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("Line3DPlot");
    super.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.startTAG("Line3DAttr").attr("seriesIntervalPercent", this.seriesIntervalPercent);
    if (getDeep() != -1)
      paramXMLPrintWriter.attr("deep", getDeep());
    paramXMLPrintWriter.end();
    if (this.projection != null)
      this.projection.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    Line3DPlot localLine3DPlot = (Line3DPlot)super.clone();
    if (this.projection != null)
      localLine3DPlot.projection = ((Projection)this.projection.clone());
    return localLine3DPlot;
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof Line3DPlot))
      return false;
    Line3DPlot localLine3DPlot = (Line3DPlot)paramObject;
    if (!(super.equals(localLine3DPlot)))
      return false;
    if (localLine3DPlot.getSeriesIntervalPercent() != getSeriesIntervalPercent())
      return false;
    if (localLine3DPlot.getDeep() != getDeep())
      return false;
    return (Equals.equals(localLine3DPlot.getProjection(), getProjection()));
  }
}